﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace HYRElectric.Equipment
{
	public class SwitchBoxesLabelChangeUpdate : IExternalApplication
	{
		public Result OnShutdown(UIControlledApplication application)
		{
			return Autodesk.Revit.UI.Result.Succeeded;
		}

		public Result OnStartup(UIControlledApplication application)
		{
			ReferenceUpdater referenceUpdater = new ReferenceUpdater(application.ActiveAddInId);
			UpdaterRegistry.RegisterUpdater(referenceUpdater);
			IList<ElementFilter> list = new List<ElementFilter>();
			ElementCategoryFilter item = new ElementCategoryFilter(BuiltInCategory.OST_ElectricalEquipment);
			list.Add(item);
			UpdaterRegistry.AddTrigger(referenceUpdater.GetUpdaterId(), list[0], Element.GetChangeTypeAny());
			return Autodesk.Revit.UI.Result.Succeeded;
		}
	}
}
